Method for storing records in database or reading the same therefrom

ABSTRACT

Method for storing records in database or reading the same therefrom comprising editing data of non-indexed field of a conventional database as a string of comment characters through a conversion table so as to store the same in a remark field of the database of the invention; and showing contents of data of the non-indexed field on a screen of the database by referring to the conversion table in reading the string of comment characters contained in the remark field of the database.

FIELD OF THE INVENTION

[0001] The present invention relates to database and more particularly to a method for storing records in database or reading the same therefrom.

BACKGROUND OF THE INVENTION

[0002] Conventionally, a database system comprises a plurality of databases and a database program. Typically, prior to establishing a database system, it is required to classify data of a record to be stored as a variety of fields based on property thereof. For example, a typical order from a manufacturer comprises fields of serial number, type, part number, unit price, etc. Such order is stored as a record in database having fields of serial number, type, part number, unit price, etc. Thus in customizing database, it is required to define a unique attribute (such as alphabet, number, date, etc.) based on contents of data to be stored in the field as well as length of respective field, and input and output conditions. Subsequently to the completion of defining fields of respective database, a database program is then able to perform input, output, or conversion on contents of data in each field of database.

[0003] In the above conventional database system, it is also required to define properties of fields in each record of database based on the contents of data to be stored as best illustrated in FIG. 1. The properties usually comprise name, attribute, length, and condition. Name is served to indicate a title (e.g., order number) of data stored in the field. Attribute is served to indicate an attribute (e.g., alphabet, number, date, etc.) of data stored in the field. Length is served to indicate a maximum bit number of input data stored in the field. Condition is served to indicate an allowable condition of input data (such as an integer smaller than 50,000 and larger than 60,000). After completing the definition of all fields, by referring to FIG. 2, it is possible to design input and output screens of each database based on each field as customized in each database. Hence, by running the database program, user may sequentially input contents of data to be stored into each field of corresponding database through input screen of database, or alternatively read and show contents of data stored in each field of corresponding database through output screen of the database.

[0004] In general, database system is served to store a great number of classified records. Thus in searching a specific record from above records or creating a relationship among various databases, it is required to select at least one field as an indexed field from each record of each database. Hence, it will be able to search the specific record in database system based on the indexed field prior to showing contents of data of that record in a screen of database. Alternatively, it will also be able to perform a relational search among various databases. Such an indexed field is meant to indicate a data field in a database having a tendency of creating a relationship with one of other databases. Therefore, an indexed field possesses a unique property to prevent an incorrect search of a record related to the indexed field from occurring in query.

[0005] As stated above, since in a typical database system it is required to define a length of each field in each database in advance. After the completion of a database system, a storage space in a memory is reserved for storing a record based on the maximum allowable length of data, irrespective of whether data has been inputted or input data has a length less than the maximum allowable length in each field of every record of each database. As a result, precious memories may be wasted since there are many fields without data stored therein or data length less than the maximum allowable length thereof. Such drawback is even serious in a large database system. Thus, for a current database system, it is very important to effectively utilize storage space of memory thereof for storing input data.

[0006] In recent years, as the rapid development of the Internet and numerous Web sites installed thereon, a variety of services are available by accessing the Internet. In a typical case, a multi-national enterprise may send (or inquiry) data through the Internet to provide updated information to branches, associated manufacturers, dealers, consumer, and so on worldwide. A service or inquiry of data is also made possible on the Internet through effectively integrating a plurality of large database systems, and providing user a desired data in a minimum period of time. Besides, it is also important for an enterprise in expanding a network to effectively utilize storage space of memory of database system for storing data communicated on the Internet.

[0007] Thus, it is desirable to provide a method for storing records in database or reading the same therefrom in order to overcome the above drawbacks such as memory wasted due to many empty data fields in database or data length less than the maximum allowable length thereof.

SUMMARY OF THE INVENTION

[0008] It is therefore an object of the present invention to provide a method for storing records in a database or reading the same therefrom comprising editing data of non-indexed field of a conventional database as a string of comment characters through a conversion table so as to store the same in a remark field of the database of the invention; and showing contents of data of the non-indexed field on a screen of the database by referring to the conversion table in reading the string of comment characters contained in the remark field of the database.

[0009] In one aspect of the present invention, the conversion table comprises a name of the non-indexed field and a corresponding code in the conventional database so that contents of data of the non-indexed field of the conventional database is capable of being edited as the string of comment characters containing the codes and the contents of data by referring to the conversion table. The string of comment characters is also stored in a remark field of the record of the database of the invention. When the database of the invention reads the remark field, it can find a corresponding name of the field by referring to the conversion table. Moreover, the database of the invention can show the contents of data on the corresponding field of an output screen of the database based on the name of the field.

[0010] The above and other objects, features and advantages of the present invention will become apparent from the following detailed description taken with the accompanying drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

[0011]FIG. 1 is a table showing fields of a record stored in a conventional database;

[0012]FIG. 2 is a view showing names of FIG. 1 arranged in another table;

[0013]FIG. 3 is a table showing fields of a record stored in a database according to the invention;

[0014]FIG. 4 is a view showing names of FIG. 3 arranged in another table;

[0015]FIG. 5 is a view showing a conversion table of the invention;

[0016]FIG. 6 illustrates a data table screen of a preferred embodiment of the invention;

[0017]FIG. 7 is a flow chart illustrating how to store a record in database of database system according to the invention; and

[0018]FIG. 8 is a flow chart illustrating how to search a record from database of database system according to the invention.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0019] The invention is directed to a method for storing records in database or reading the same therefrom in which a format of each field is defined with respect to a plurality of data to be stored in database of database system. Preferably, fields comprise a plurality of indexed fields and a remark field. Referring to FIGS. 3 to 6, an example of database of parts supplied by a manufacturer is described. As shown, indexed fields comprises Pnc (parts code), Descr (description), and TP (parts types) fields. In the database of parts, record of each data only comprises a plurality of indexed fields and a remark field (FIG. 4). Remark is served to store a string of character as comment. In the invention, data of each record in a conventional database belonging to non-indexed field (i.e., non-indexed data) is permitted to input to a corresponding field of an input data table through an input screen of database. Then data of each field of data table is edited as a string of comment characters through a conversion table so as to store the same in remark field of each record. Next in reading the record, database system of the invention can translate contents of data of remark field by referring to the conversion table again. Finally, show the same on a corresponding field of data table of output screen.

[0020] In the invention (see FIGS. 5 and 6), conversion table comprises a name of non-indexed data to be stored (e.g., CPQ Part No.) and a corresponding code (e.g., PN) in each record. Hence, data of corresponding field inputted to input data table may be edited as a string of comment characters containing codes and contents of data by referring to the conversion table, and the string of comment characters is then stored in remark field of each record of database. As such, when database system reads each record, it will be able to find a corresponding name of field from conversion table by referring to the codes contained in the string of comment characters in remark field. Then the name of field and corresponding data are shown on a corresponding field of data table of output screen of database respectively.

[0021] Referring to FIG. 6, as database system of the invention receives input non-indexed data from user through a corresponding field of data table of input screen, it may translate a name of corresponding field (e.g., CPQ Part No.) of data table into a corresponding code (e.g., PN) through the conversion table. Next add an identification symbol (e.g., =) between code and corresponding contents of data of each non-indexed data and add a demarcation symbol (e.g., ˜) between adjacent data by referring a specific editing definition. As a result, all input non-indexed data of input screen are edited as a string of comment characters (e.g., PN=470013-471˜CFG=JMWZ˜ . . . ) and stored the same in a remark field of a record of above database of the invention. Thereafter, when database system of the invention reads the record, it is able to identify the identification symbol for correctly reading the code and corresponding contents of data, and identifying the demarcation symbol for correctly locating an end position of contents of data and a beginning position of a next code and corresponding contents of data.

[0022] Referring to FIG. 6 again, there is illustrated a data table 6 of input (or output) screen designed by a database program of database system according to the invention. On the data table 6 there are provided a plurality of fields 60 and 62 for inputting (or outputting) indexed data and non-indexed data respectively. Thus, user may sequentially input contents of data to be stored in corresponding fields 60 and 62 through data table 6. Alternatively, user may read contents of data from database and show the same on corresponding fields 60 and 62 of data table 6. Since the corresponding fields 62 of data table 6 reserved for non-indexed data input are designed based on names of fields of conversion table. If there is a desire to increase or decrease number of corresponding field 62 of data table 6 for inputting additional non-indexed data, the invention only needs to modify the number of corresponding field 62 of data table 6 and name of field and code of conversion table. However, a conventional database system requires to increase (or delete) field of each database. As an end, the invention can avoid database system from abnormally operating due to incorrect increase or deletion of data field of database.

[0023] In the invention, length of remark field in database is obtained by estimating a total length of all non-indexed data in each record to be stored in database. Thus, it is possible to increase or decrease a storing of non-indexed data in each record by simply modifying length of the remark field. Moreover, since remark is served to store all non-indexed data inputted in each record, unlike a conventional database system, the invention doesn't need to reserve a storage space of memory for storing field of each non-indexed data. As a result, capacity of database can be used more effectively.

[0024] Referring to FIG. 7, there is shown a process of a preferred embodiment of the invention. Database program of database system performs the following steps for permitting a user to sequentially store input indexed data and non-indexed data in a record of database through data table on an input screen.

[0025] In step 701, show a data table of an input screen on a display. Fields of data table for inputting indexed data are linked to indexed fields defined by database while fields of data table for inputting non-indexed data are linked to a conversion table.

[0026] In step 702, after indexed data and non-indexed data being sequentially inputted into corresponding field through data table of input screen by user, database system may directly store the input indexed data of data table in an indexed field of a record in database and sequentially read corresponding field of data table filled with input non-indexed data.

[0027] In step 703, a determination is made whether there is any input data in each corresponding field. If yes, process goes to step 704. Otherwise, process goes to step 706.

[0028] In step 704, a determination is made whether field is the last corresponding field. If yes, process goes to step 705. Otherwise, process goes to step 706.

[0029] In step 705, find a corresponding code from conversion table based on name of field of the read non-indexed data. Then non-indexed data is edited as a string of comment characters by referring to code of conversion table so as to store the same in remark field of database.

[0030] In step 706, read a next corresponding field. Then process loops back to step 703.

[0031] Referring to FIG. 8, there is shown a process according to the invention illustrating the program of database system searching a record from database in accordance with indexed data inputted by user in data table on an output screen. The process comprises the following steps:

[0032] In step 801, after indexed data being inputted in corresponding fields through data table of output screen by user, database system may search a corresponding database based on input indexed data of data table and read a record which is related to input indexed data.

[0033] In step 802, read data stored in each indexed field of record and show the same on data table of output screen for showing corresponding fields of indexed data. Next read a string of comment characters stored in remark field of record.

[0034] In step 803, translate all non-indexed data contained in the string of comment characters based on code and name of field defined by conversion table.

[0035] In step 804, show the translated non-indexed data on data table of output screen for showing corresponding fields of non-indexed data.

[0036] While the invention has been described by means of specific embodiments, numerous modifications and variations could be made thereto by those skilled in the art without departing from the scope and spirit of the invention set forth in the claims. 

What is claimed is:
 1. A method for storing records in a database or reading the same therefrom, the method comprising: defining a plurality of fields of each record in each of a plurality of databases of a database system with respect to a plurality of data to be stored wherein the fields include a plurality of indexed fields and a remark field; inputting all of non-indexed data to a corresponding field of a data table through a data table of an input screen of the database system; editing input data of each corresponding field of the data table as a string of comment characters through a conversion table so as to store the same in the remark field of each record; translating contents of each data of the remark field by referring to the conversion table by the database system in reading the record; and showing the same on one of fields of the data table of an output screen.
 2. The method of claim 1, wherein the conversion table comprises a name of the non-indexed data to be stored and a corresponding code in each record so that data of the corresponding field inputted to the data table is capable of being edited as the string of comment characters containing the codes and the contents of data by referring to the conversion table.
 3. The method of claim 1 or 2, wherein when the database system receives the input non-indexed data through the corresponding field of the input data table, further comprising translating a name of the corresponding field of the data table into a corresponding code through the conversion table and adding an identification symbol between the code and the corresponding contents of data of each non-indexed data, and adding a demarcation symbol between adjacent data by referring a predetermined editing definition, and editing all of the input non-indexed data of the input screen as the string of comment characters.
 4. The method of claim 3, wherein the database system for sequentially storing input indexed data and non-indexed data in the corresponding record of the database through the data table performs the steps of: showing the data table of on a display wherein the fields of the data table for the input indexed data are linked to the indexed fields defined by the database while the fields of the data table for inputting the non-indexed data are linked to the conversion table; directly storing the input indexed data of the data table in the indexed fields of the record in the database and sequentially reading the corresponding field of the data table filled with the input non-indexed data; first determining whether there is any input data in each corresponding field and if the first determination is positive performing the step of second determining whether the corresponding field is the last corresponding field; and if the second determination is positive performing the steps of finding the corresponding code from the conversion table based on the name of the field of the read non-indexed data, and editing the non-indexed data as the string of comment characters by referring to the code of the conversion table so as to store the same in the remark field of the database.
 5. The method of claim 4, wherein the database system for searching a record from the corresponding database through the input indexed data of an output data table performs the steps of: searching a corresponding database based on the indexed data of input data table and reading a record which is related to the input indexed data; reading data stored in each indexed field of the record, showing the same on the data table of the output screen for showing the corresponding fields of the indexed data, and reading the string of comment characters stored in the remark field of the record; translating all of the non-indexed data contained in the string of comment characters based on the code and the name of field defined by the conversion table; and showing the translated non-indexed data on the data table of the output screen for showing the corresponding fields of the non-indexed data. 